package edu.bit.water.dao;

import java.util.List;
import java.util.Map;

import edu.bit.water.entity.EntitySensor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface EntitySensorDao {
	
	int insertEntitySensor(Map<String, Object> map);
	int deleteEntitySensor(int id);
	List<Map<String, Object>> selectEntitySensor(@Param("techProcessId") String techProcessId);
	int updateEntitySensor(Map<String, Object> map) throws DuplicateKeyException;
	List<String> selectEntitySensorName();
	//查询Id和Name
	List<Map<String, Object>> selectEntitySensorIdAndName();
	//根据ID查询该Id字段及值
	Map<String, Object> selectEntitySensorById(@Param("id") int id);
	String queryNameBySensorRowId(@Param("businessId") String businessId, @Param("sensor_row_id") String sensor_row_id);
	int queryEntityStatus(int id);
	Integer getMaxId();

	String queryElemType(@Param("columnDefination") String columnDefination);


	String queryWorkshopBySensorRowId(@Param("sensorRowId") String sensorRowId);
	String queryTypeBySensorRowId(@Param("sensorRowId") String sensorRowId);
	String queryTechprocessIdBySensorRowId(@Param("sensorRowId") String sensorRowId);

	List<Map<String, Object>> selectEntitySensorBySensorId(@Param("businessId") String businessId,@Param("sensor_row_id") String sensor_row_id);

	/**
	 * 根据条件查询传感器
	 * @return
	 */
	List<EntitySensor> queryEntitySensor(@Param("entity") EntitySensor entity);
}
